#include "State.h"
#include "Actor.h"

void CStateBlock::Enter()
{
	// Set actor to idle animation.
	pActor->pActiveAnimation = &pActor->animBlock;

	// Set actor's chart
	pActor->dxcFlow.SetAnchor(CHART_BLOCK);

	// Log the Enter() in the Actor's message queue
	pActor->messageQueue.push_front("CStateBlock::Enter()");
	messageTimer.Set(MESSAGE_FREQUENCY);
}

bool CStateBlock::Update()
{
	pActor->pActiveAnimation->Update();

	if(messageTimer.Check())
	{
		// Log the Enter() in the Actor's message queue
		pActor->messageQueue.push_front("CStateBlock::Update()");
		messageTimer.Set(MESSAGE_FREQUENCY);
	}

	// State update successful...
	return true;
}

void CStateBlock::Exit()
{
	// Log the Enter() in the Actor's message queue
	pActor->messageQueue.push_front("CStateBlock::Exit()");

}
